package com.fh.test.spring.xmlconfig.soundsystem;

import org.springframework.stereotype.Component;

/**
 * @author  tuliang on 2017/12/8.
 */
@Component
public class SgtPepers implements CompactDisc{
    /**
     * CD名称
     */
    private String title = "";

    /**
     * CD 作者
     */
    private String artist = "";
    /**
     * 播放CD
     */
    public void play() {
        System.out.println("Playing " + getTitle() + " by " + getArtist());
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getArtist() {
        return artist;
    }

    public void setArtist(String artist) {
        this.artist = artist;
    }

    @Override
    public String toString(){
        return (this.getClass().getSimpleName() + "[" + " title="+ getTitle() + " artist=" +  getArtist() +"]");
    }
}
